package com.lzj.server.entity.video;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.lzj.server.entity.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serial;

@Schema(name = "Category", description = "通用分类表，支持多级结构和多业务分类使用")
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("category")
public class Category extends BaseEntity {
    @Serial
    private static final long serialVersionUID = 760778354138038156L;
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键，自增 ID")
    private Long id;
    @TableField("name")
    @Schema(description = "分类名称，如 科技、音乐")
    private String name;
    @TableField("parent_id")
    @Schema(description = "父级分类 ID，0 表示一级分类")
    private Long parentId;
    @TableField("type")
    @Schema(description = "分类用途标识，如 video、article、tag 等")
    private String type;
    @TableField("sort")
    @Schema(description = "排序字段，数字越小越靠前")
    private Integer sort;
    @TableField("description")
    @Schema(description = "分类说明描述")
    private String description;

}

